package com.lhkj.ct.meta.modules.scheduling.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lhkj.ct.base.json.databind.IEnumSerializer;
import com.lhkj.ct.base.validator.group.ValGroups;
import com.lhkj.ct.meta.modules.scheduling.common.enums.AppointStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.groups.Default;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * <p>
 * 预约记录表
 * </p>
 *
 * @author jobob
 * @since 2023-10-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TblScheAppoint对象", description="预约记录表")
public class TblScheAppoint implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "预约id")
    private String id;

    @NotBlank(message = "档案id不能为空", groups = {ValGroups.User.class, ValGroups.Insert.class})
    @ApiModelProperty(value = "档案id")
    private String patId;

    @NotBlank(message = "项目编码不能为空", groups = {Default.class, ValGroups.Insert.class})
    @ApiModelProperty(value = "项目编码")
    private String itemCode;

    @NotBlank(message = "项目名称不能为空", groups = {Default.class, ValGroups.Insert.class})
    @ApiModelProperty(value = "项目名称")
    private String itemName;

    @NotBlank(message = "联系方式不能为空", groups = {Default.class, ValGroups.Insert.class})
    @ApiModelProperty(value = "联系方式")
    private String concatPhone;

    @NotBlank(message = "排班id不能为空", groups = {Default.class, ValGroups.Insert.class})
    @ApiModelProperty(value = "排班id")
    private String scheId;

    @ApiModelProperty(value = "状态 0.待签到 1.已签到 2.已完成 3.已取消 ")
    @JsonSerialize(using = IEnumSerializer.class)
    private AppointStatus status;

    @ApiModelProperty(value = "治疗人")
    private String treatDoc;

    @ApiModelProperty(value = "治疗时间")
    private LocalDateTime treatTime;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "姓名")
    private String patName;

    @TableField(exist = false)
    @ApiModelProperty(value = "性别")
    private String patSex;

    @TableField(exist = false)
    @ApiModelProperty(value = "年龄")
    private String patAge;

    @TableField(exist = false)
    @ApiModelProperty(value = "预约医生")
    private String scheDoc;

    @TableField(exist = false)
    @ApiModelProperty(value = "预约日期")
    private LocalDate scheDate;

    @TableField(exist = false)
    @ApiModelProperty(value = "预约时段")
    private String scheTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "门诊/诊疗(卡)号")
    private String patCardNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "住院号")
    private String patInNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "预约科室")
    private String scheDept;

    @TableField(exist = false)
    @ApiModelProperty(value = "开始时间")
    private LocalTime startTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "截止时间")
    private LocalTime endTime;
}
